Copyright: Copyright © Eminent Domain Software


AbortMesg Constant

Unit

SpellGbl

Declaration

AbortMesg : array[TLanguages] of string;

Description

Contains the messages for the abort box of the EDSSpell checking component for the various supported languages.


About EDSSpell

The EDSSpell Component allows Delphi developers to easily include a Spell Checking Dialog into their Delphi applications.  EDSSpell is a native Delphi component which means there are no additional DLLs or VBXs which need to be distributed with your application (except for the dictionary file(s)).  Applications distributed using EDSSpell may be deployed royaltee free.

If you have a trial-version of EDSSpell you will be presented with an innocent nag screen.  You may select to own the product for $99 and receive a full "nag-less" version which also includes a free 250,000 word Spanish Dictionary (the English one includes 120,000 words), a 161,000 word British Dictionary, a 116,000 word Dutch Dictionary, and a 60,0000 Italian Dictionary.  Other dictionaries are available upon request.

EDSSpell Internals

The EDSSpell component uses a highly optimized DAWG (Directed Acyclic Word Graph) as its spell checking engine.  In 1988, Andrew Appel, an assistant professor at Princeton University, published an article in the Communication of the ACM (Association for Computing Machinery) entitled "The World's Fastest Scrabble Game."  In it, Appel details the construction of a Trie and then of a DAWG to store a 94,240 word lexicon.  The lexicon is represented as a tree whose edges are labeled by letters.   The following tree displays the word BAT, BATCH, CAT, CATCH, HAT, HATCH and HORSE (the # represents the end of a word):

Walking the DAWG

By traveling along the graph we construct the words which make up the lexicon.  Further analysis of the structure leads us to further optimize the graph:

By using this type of structure, EDSSpell is able to spell check documents incredibly fast (±55,000 words per minute on a 486-66).  An additional benefit of optimizing is the substantial reduction in size of the graph.  Our 243,000 word Spanish dictionary is 2,861,185 bytes as a text file, but is stored as a 250,119 byte DAWG (including our header).  That's 8% of its original size!

What's in an Edge?

An edge (or letter in our graph) is defined as a 3 or 4 byte structure which contains the letter, whether that letter is the end of a word or node, and a pointer to the next edge.  We decided to use a 4 byte structure to enable us to store the entire 256 letter ASCII character-set to fully support international languages.  Our edge looks like this:

 |CCCCCCCC|  -  |CCCCCCCC|  -  |NWRRRCCC|  -  |LLLLLLLL|

where 	C - child bits

N - End of a node bit

W - Word End bit

R - Reserved bits

L - Letter bits

Teaching an old DAWG

There's more that these structures can be used for (thus the reserved space).  Future enhancements will include support for several advanced features.  Let us know about enhancements that you would like to see in our next releases.  We'll be adding'em in the Professional version of EDSSpell and our Delphi 2.0 w/ RTF version.


AbsSpell Unit

See Also

The AbsSpell unit contains the declarations for abstract dialog box declaration for the EDSSpell checking component.

The following items are declared in the AbsSpell unit:

Objects

TAbsSpellDialog

Types

TAccents

TAccentSet

Constants

mrReplace

mrAdd

mrSkipOnce

mrSkipAll

mrReplaceAll

mrSuggest


AccentIcons
AccentIcons Property

Applies to

TSpellDlg component

Declaration

property AccentIcons: TAccentSet;

Description

The AccentIcons property allows you to display icons on the Spell dialog which enable the user to easily input foreign characters.

The default is [], the empty set, meaning their are no accent icons on the Spell dialog.


AutoShift Property

Example

Applies to

TSpellDlg component

Declaration

property AutoShift: Boolean;

Description

When the AutoShift property is TRUE, the Spell dialog will move so that it does not overlap the highlighted word on the parent control.


AutoSuggest Property

See Also	Example

Applies to

TSpellDlg component

Declaration

property AutoSuggest: Boolean;

Description

The AutoSuggest property controls whether the Spell dialog will automatically suggest alternatives when an unknown word is encountered.


CheckAllFields Method

See Also

Applies to

TSpellDlg component

Declaration

function CheckAllFields (AForm: TForm; DisplayMsg: Boolean): integer;

Returns

mrCancel if user canceled spell checking, mrNone if there were no errors found, and mrOk otherwise.

Description

Checks all supported fields on the form.  This includes TMemo, TEdit, TDBEdit, and the Orpheus components.  if DisplayMsg is TRUE then the funtion displays a message such as Spell Checking Complete after checking all the fields.


CheckCustomEdit Method

See Also

Applies to

TSpellDlg component

Declaration

function CheckCustomEdit (ACustomEdit: TCustomEdit): Integer;

Returns

mrCancel if user canceled spell checking, mrNone if there were no errors found, and mrOk otherwise.

Description

Checks a TCustomEdit field.  This method will rarely be called, but is provided in the event that you have create a descendant of TCustomEdit.  Typically, you will call CheckMemo (for a TMemo), CheckEdit (for a TEdit).


CheckEdit Method

See Also

Applies to

TSpellDlg component

Declaration

function CheckEdit (AMemo: TEdit): Integer;

Returns

mrCancel if user canceled spell checking, mrNone if there were no errors found, and mrOk otherwise.

Description

Checks a TEdit component.


CheckMemo Method

See Also

Applies to

TSpellDlg component

Declaration

function CheckMemo (AMemo: TMemo): Integer;

Returns

mrCancel if user canceled spell checking, mrNone if there were no errors found, and mrOk otherwise.

Description

Checks a TMemo field.


CheckOvcEditor Method

See Also

Applies to

TSpellDlg component

Declaration

function CheckOvcEditor (AnOvcEdit: TOvcCustomEditor): Integer;

Returns

mrCancel if user canceled spell checking, mrNone if there were no errors found, and mrOk otherwise.

Description

Checks an Orpheus editor field.  By default, Orpheus support is disabled.  This method will be unavailable unless you enable the SupportOrpheus define in the SPELLDEF.PAS file.


CheckOvcField Method

See Also

Applies to

TSpellDlg component

Declaration

function CheckOvcField (AnOvcField: TOvcBaseEntryField): Integer;

Returns

mrCancel if user canceled spell checking, mrNone if there were no errors found, and mrOk otherwise.

Description

Checks an Orpheus editor field.  By default, Orpheus support is disabled.  This method will be unavailable unless you enable the SupportOrpheus define in the SPELLDEF.PAS file.


CheckTXControl Method
CheckTextControl Method

Applies to

TSpellDlg component

Declaration

function CheckTXControl (ATXControl: TTextControl): Integer;

Returns

mrCancel if user canceled spell checking, mrNone if there were no errors found, and mrOk otherwise.

Description

Checks a TX Text-Control component.  By default, TX Text-Control support is disabled.  This method will be unavailable unless you enable the SupportTXText define in the SPELLDEF.PAS file.


CheckWPText Method

Applies to

TSpellDlg component

Declaration

function CheckWPText (AWPRichText: TWPRichText): Integer;

Returns

mrCancel if user canceled spell checking, mrNone if there were no errors found, and mrOk otherwise.

Description

Checks a WPTools component.  By default, WPTools support is disabled.  This method will be unavailable unless you enable the SupportWPTools in the SPELLDEF.PAS file.


CheckWord Method

See Also

Applies to

TSpellDlg component

Declaration

function CheckWord (var AWord: String): integer;

Description

Checks a word in the dictionary, properly updating the spell dialog appropriately.  The possible return values for CheckWord are:

Result	Description
mrNone	No Return
mrReplace	Replace with string in AWord
mrSkipOnce	Word skipped once
mrSkipAll	Spell Checker will skip all subsequent instances of word
mrReplaceAll	All instances of this word should be replaced


Checking other Components

See Also

You can check many types of components as long as they are descendants of one of the natively supported components.

Many components are descendants of the TCustomEdit component.  This is true for TMemos, TDBMemos, TEdits, etc.  You can check any of these components by calling the SpellDlg.CheckCustomEdit function.  So to spell check a TDBMemo component:

procedure TForm1.SpellCheckBtnClick (Sender: TObject);

begin

  SpellDlg1.CheckCustomEdit (DBMemo1);

end;  { TForm1.SpellCheckBtnClick }

When checking database components it is up to you to make sure that the table is in edit mode (i.e. Table1.Edit).  The spell component does not do this for you.  It also does not do a post (i.e. Table1.Post).

Note: If you find a popular component which cannot be readily spell checked by EDSSpell, please contact Eminent Domain Software.


ClearLists Method

Applies to

TSpellDlg component

Declaration

procedure ClearLists;

Description

Clears the SkipList, ReplaceList, and Replacer list.


ClearSuggestList Method

Applies to

TAbsSpellDialog, TMSSpellDlg, TWPSpellDlg and W96SpellDlg components

Declaration

procedure ClearSuggestList; dynamic;

Description

Clears the suggestion list.  This method will rarely be called directly since it is already called for you by the SpellDlg component.


Close Method

See Also

Applies to

TSpellDlg

Declaration

procedure Close;

Description

Closes the dictionary and removes the dialog.  You will rarely have to call the Close method since it is called for you by the various check routines (e.g. CheckMemo, CheckEdit).


CloseDictionary Method

See Also

Applies to

TSpellDlg

Declaration

procedure Close;

Description

Closes the dictionary.  You will rarely have to call the CloseDictionary method since it is called for you by the various check routines (e.g. CheckMemo, CheckEdit).


CompleteMesg Constant

Unit

SpellGbl

Declaration

CompleteMesg : array[TLanguages] of string;

Description

Contains the messages for the completed dialog of the EDSSpell checking component for the various supported languages.


Create Constructor

See Also

Applies to

TSpellDlg

Declaration

Constructor Create (AOwner: TComponent);

Description

Constructor for SpellDlg.  You should never need to call this directly as Delphi will handle it for you.


CustomEdit_WordCount Method

See Also

Applies to

TSpellDlg

Declaration

procedure CustomEdit_WordCount (ACustomEdit: TCustomEdit;

var Words, UniqueWords: Longint);

Result

The number of words is returned the Words variable, while the number of unique words is returned in the UniqueWords variable.

Description

Displays a dialog box containing the number of words and unique words.


Destroy Method

See Also

Applies to

TSpellDlg

Declaration

destructor Destroy;

Description

Destructor for SpellDlg.  You should never have to call this directly as Delphi handles this for you.


DialogStyle Property

Example

Applies to

TSpellDlg component

Declaration

property DialogStyle: TDialogTypes;

Description

The DialogStyle property enables you to decide how you want your Spell dialog to look.  The prossible values for DialogStyle are:

dtWordPerfect, dtMSWord,  dtWord96 for WordPerfect style, MS-Word style and WordPro 96 style, respectively.


DictExt Constant

Unit

SpellGbl

Declaration

const DictExt : string[4] = '.DIC';

Description

Contains the default dictionary extension for the EDSSpell checking component.


Dictionaries Constant

Unit

SpellGbl

Declaration

const Dictionaries : array[TLanguages] of string[8];

Description

Contains the default names for the dictionaries of the EDSSpell checking component for the various supported languages.


DictionaryName Property

See Also	Example

Applies to

TSpellDlg component

Declaration

property DictionaryName: string[8];

Description

The DictionaryName property contains the name of the dictionary to be used.  If this is blank the default dictionary is used for each language.


DictionaryPath Property

See Also	Example

Applies to

TSpellDlg component

Declaration

property DictionaryPath: string;

Description

The DictionaryPath property contains the path where the dictionary can be found.  The default for this value if ApplicationPath which forces the spell engine to search the applications path for the dictionary.


DictionaryType Property

Example

Applies to

TSpellDlg components

Declaration

property DictionaryType: TLanguages;

Description

The type or language of the dictionary.


DisableSkipButtons
DisableSkipButtons Method

Applies to

TAbsSpellDialog, TMSSpellDlg, TWPSpellDlg and W96SpellDlg components

Declaration

procedure DisableSkipButtons; dynamic;

Description

Disables the Skip and Skip All buttons on the dialog.  This method will rarely be called directly since it is already called for you by the SpellDlg component.


EDSSpell Defines

See Also

The EDSSpell component supports several components.  An SpellDef.PAS file is included to allow the most versatile use of the component.  Eminent Domain Software must provide specific support for those components which are not descended from the TCustomEdit component.  We currently only have direct support for TurboPower's Orpheus components, European Software Connection's TX Text-Control, and Julian Ziersch's WPTools.

To enable support for Orpheus components remove the period from the statement {.$DEFINE SupportOrpheus} in the SPELLDEF.PAS file.

To enable support for TX Text-Control remove the period from the statement {.$DEFINE SupportTXText} in the SPELLDEF.PAS file.

To enable support for the WPTools RTF component remove the period from the statement {.$DEFINE SupportWPTools} in the SPELLDEF.PAS file.

To insure that support has been compiled into the EDSSpell component select Options|Rebuild Library from the Delphi menu.


EDSSpell Unit

See Also

The EDSSpell unit contains the declarations for the Spell dialog box found on the Dialogs page of the Component palette.

When you add a component declared in this unit to a form, the unit is automatically added to the uses clause of that form's unit.

The following items are declared in the EDSSpell unit:

Components

TSpellDlg


Edit_WordCount Method

See Also

Applies to

TSpellDlg

Declaration

procedure Edit_WordCount (AnEdit: TEdit; var Words, UniqueWords: Longint);

Result

The number of words is returned the Words variable, while the number of unique words is returned in the UniqueWords variable.

Description

Displays a dialog box containing the number of words and unique words.


Eminent Domain Software

"Custom Software Development For Your Domain"

e-mail: 	CIS 70600,3451     SWREG #8482

Internet:  	easalgad@icsi.net

mail:    	413 Gale Street

East Entrance

Laredo, TX  78041 USA

phone: 	(210) 729-0123

fax:	(210) 729-0011

Download the latest trial version of EDSSpell from the Delphi VCL Library on CompuServe or the Delphi Developer's

Library at:

http://www.computer-shopper.com/magazine/delphi.htm

You can own the EDSSpell component for only $99.


EnableSkipButtons Method

Applies to

TAbsSpellDialog, TMSSpellDlg, TWPSpellDlg and W96SpellDlg components

Declaration

procedure EnableSkipButtons; dynamic;

Description

This method will enable the Skip and Skip All buttons on the spell dialog.  This method will rarely be called directly since it is already called for you by the SpellDlg component.


European Software Connection

See Also

European Software Connection can be contacted at:

European Software Connection

1617 Saint Andrews Drive

Lawrence, KS  66047

Voice: (913) 832-2070

Fax: (913) 832-8787


Extras

You will also notice TEntEdit, TNewListBOX, and TDBEntEdit, TNewDBGrid on the Samples page of the Delphi Component Palette.  The following describes these components:

Component Name	Descendant of...	Change

TNewListBox	TListBox	Added OnChange event

TEntEdit	TEdit	[Enter] works as [Tab]

CTRL+UP Uppercases string

CTRL+DOWN Caps string

TNewDBGrid	TDBGrid	Added OnClick event

TDBEntEdit	TDBEdit	{same as TEntEdit}

Those components are freeware and you can use them in any of your Delphi applications.

You have also been provided with a free Execute Delphi Utility!


FoundPhrase Constant

Unit

SpellGbl

Declaration

FoundPhrase : array[TLanguages] of string;

Description

Contains the messages for the found label of the EDSSpell checking component for the various supported languages.


GetEditWord Method

Applies to

TAbsSpellDialog, TMSSpellDlg, TWPSpellDlg and W96SpellDlg components

Declaration

function GetEditWord: string; dynamic;

Description

Returns the current word in the edit field of the spell dialog.  This method will rarely be called directly since it is already called for you by the SpellDlg component.


InDictionary Method

Applies to

TSpellDlg

Declaration

function InDictionary (AWord: String): Boolean;

Description

Checks to see if the specified word is in the dictionary.  You will rarely have to call the InDictionary method since it is called for you by the various check routines (e.g. CheckMemo, CheckEdit).


Installation
Installation Instructions

See Also

Installing the EDSSpell Help

The install program copies a help file and a keyword file to the EDSVCL directory.  To install the EDSSpell integrated help into Delphi, copy the EDSSPELL.HLP file into the DELPHI\BIN directory and copy the EDSSPELL.KWF file into the DELPHI\HELP directory.

Install EDSSPELL.KWF by running Delphi's HelpInst utility (do not do this while Delphi is running).  Select File|Open from the menu and open DELPHI.HDX in the DELPHI\BIN directory.  A list of current *.KWF files is shown.  Select the Keywords|Add option from the menu and add the EDSSPELL.KWF file.  Select File|Save and exit HelpInst.

Adding the components to Delphi's Component Palette

The files for Eminent Domain Software's EDSSpell Component for Borland's Delphi programming environment have been copied to your hard disk.  Before you can use EDSSpell, you must add the SpellDlg component to the Delphi component palette.  Follow the instructions below to complete the installation:

1)  Execute Delphi.

2)  If you would like to have support for TurboPower's Orpheus™ component, you must enable it in the SPELLDEF.PAS file.  See EDSSpell Defines for more information.

3)  In Delphi select Options|Install Components|Add and browse your vcl source code directory.

4)  Select EDSUTIL.PAS, EDSDB.PAS and EDSSPELL.PAS.

After the component library is rebuilt, you will notice the SpellDlg on the Domain tab of your component palette.

Upgrading from version 1.x

Critical: The dictionary format has changed!!  The old dictionaries will not work!  We have enhanced the dictionary format for speed and flexibility.  See About the EDSSpell Component for more information.

Follow the instructions for running the setup program as detailed above.  You will note that there is no longer a DLL to redistribute with your application.  You need not worry if you were using SPELLINT.PAS to access the DLL directly.  We have provided a new SPELLINT.PAS which uses the new TDictionary class.

For those of you who want complete source code for the dictionary engine (LEXDCT.DCU, LEXLIST.DCU), we will be publishing a professional version which contains complete source code as well as a program which allows you to compile your own dictionaries.  Contact us if you would like to be notified when the professional version is available.

About the EDSSpell Component

Using TSpellDlg

Registering EDSSpell

As a bonus, you have received the ExDelphi utility to Unclutter the Delphi Desktop.


Introduction

"Custom Software Development For Your Domain"

EDSSpell Component v2.4

(c) Copyright 1995, Eminent Domain Software and Ed Salgado

This component allows Delphi developers to easily add Spell Checking Dialog to their Delphi applications.  This new version includes an expanded feature set including support for TurboPower's powerful Orpheus™ components,  TX Text-Control™ which ships with Borland's Visual Solutions Pack and is distributed by the European Software Connection, and the shareware RTF component WPTools by Julian Ziersch.

Table of Contents

Installation Instructions

EDSSpell Defines

About EDSSpell

Using EDSSpell

TSpellDlg

with Orpheus

with TX-Text Control

with WPTools

Registering EDSSpell

Extras

Contacting Eminent Domain Software


LabelLanguage Property

Example

Applies to

TAbsSpellDialog, TMSSpellDialog, TSpellDlg, TWPSpellDialog, TW96SpellDlg components

Declaration

property LabelLanguage: TLanguages;

Description

Sets the language for the spell dialog's labels and buttons.


MSSpell Unit

See Also

The MSSpell unit contains the declaration for the MicroSoft Word™ style spell dialog available for the EDSSpell checking component.

The following items are declared in the MSSpell unit:

Components

TMSSpellDlg


MakeSuggestions Method

Applies to

TAbsSpellDialog, TMSSpellDlg, TWPSpellDlg and W96SpellDlg components

Declaration

procedure MakeSuggestions; dynamic;

Description

This method forces the spell checker to make suggestions on the current word.  MakeSuggestions is called when a user selects the Suggest button from the spell dialog.  This method will rarely be called directly since it is already called for you by the SpellDlg component.


Margin Constant

Unit

SpellGbl

Declaration

const Margin = 10;

Description

Used to help move the Spell dialog when the AutoShift property is set to TRUE.  The dialog box never gets closer than Margin to the edge of the screen.


MaxBuffer Constant

Unit

SpellGbl

Declaration

const MaxBuffer = 65535;

Description

Maximum size of the a contiguous stream of text than can be used by EDSSpell checking component.


Memo_WordCount Method

See Also

Applies to

TSpellDlg

Declaration

procedure Memo_WordCount (AMemo: TMemo; var Words, UniqueWords: Longint);

Result

The number of words is returned the Words variable, while the number of unique words is returned in the UniqueWords variable.

Description

Displays a dialog box containing the number of words and unique words.


MoveDialog Method

See Also

Applies to

TSpellDlg

Declaration

procedure MoveDialog (YPos: integer);

Description

Moves the dialog so that it does not cover the y position on the screen. You will rarely have to call the MoveDialog method since it is called for you by the various check routines (e.g. CheckMemo, CheckEdit).


NoErrorMesg Constance

Unit

SpellGbl

Declaration

NoErrorMesg : array[TLanguages] of string;

Description

Contains the messages for the no errors box of the EDSSpell checking component for the various supported languages.


NotFoundPhrase Constant

Unit

SpellGbl

Declaration

NotFoundPhrase : array[TLanguages] of string;

Description

Contains the messages for the not found label of the EDSSpell checking component for the various supported languages.


Open Method

See Also

Applies to

TSpellDlg

Declaration

procedure Open;

Description

Opens the dictionary and displays the dialog.  You will rarely have to call the Open method since it is called for you by the various check routines (e.g. CheckMemo, CheckEdit).


OpenDictionary Method

See Also

Applies to

TSpellDlg

Declaration

function OpenDictionary: Boolean;

Description

Opens the dictionary, returning TRUE if successful.  You will rarely have to call the OpenDictionary method since it is called for you by the various check routines (e.g. CheckMemo, CheckEdit).


Orpheus
Orpheus™

See Also

Orpheus is a collection of native VCL (Visual Component Library) components that extend the user interface design capabilities of Delphi.  The EDSSpell component supports the TOvcCustomEditor class and its descendants (which include TOvcEditor, TOvcTextFileEditor, TOvcDbEditor) as well as the TOvcBaseEntryField class and its descendants (which include TOvcCustomSimpleField, TOvcSimpleField, TOvcDbSimpleField, TOvcBasePictureField, TOvcCustomPictureField, TOvcPictureField, TOvcDbPictureField).  For more information on Orpheus, consult your Orpheus manual or contact Turbo Power Software.

Enabling Orpheus Support

Using EDSSpell with Orpheus


OvcEdit_WordCount Method

See Also

Applies to

TSpellDlg

Declaration

procedure OvcEdit_WordCount (AnEdit: TOvcCustomEditor;

var Words, UniqueWords: Longint);

Result

The number of words is returned the Words variable, while the number of unique words is returned in the UniqueWords variable.

Description

Displays a dialog box containing the number of words and unique words.

By default, Orpheus support is disabled.  This method will be unavailable unless you enable the SupportOrpheus define in the SPELLDEF.PAS file.


OvcField_WordCount Method

See Also

Applies to

TSpellDlg

Declaration

procedure OvcField_WordCount (AField: TBaseEntryField;

var Words, UniqueWords: Longint);

Result

The number of words is returned the Words variable, while the number of unique words is returned in the UniqueWords variable.

Description

Displays a dialog box containing the number of words and unique words.

By default, Orpheus support is disabled.  This method will be unavailable unless you enable the SupportOrpheus define in the SPELLDEF.PAS file.


Registering EDSSpell

It is important that you register your copy of the EDSSpell Component for Delphi.  Registering the component enables you to get technical support for the component, free bug fixes and notices of updates.  To register, print the file SPELLREG.WRI, fill it out and mail it to Eminent Domain Software.


ReplaceList Property

See Also

Applies to

TSpellDlg component

Declaration

property ReplaceList: TStringList;

Description

A string list of words to be replaced.


Replacer Property

See Also

Applies to

TSpellDlg component

Declaration

property Replacer: TStringList;

Description

A string list of words to replace those words in the ReplaceList.


SetAccentSet Method

Applies to

TAbsSpellDialog, TMSSpellDlg, TWPSpellDlg and W96SpellDlg components

Declaration

procedure SetAccentSet (Accents: TAccentSet);   dynamic;

Description

Sets the accent set for the spell dialog.  This method will rarely be called directly since it is already called for you by the SpellDlg component.


SetEditAsActive Method

Applies to

TAbsSpellDialog, TMSSpellDlg, TWPSpellDlg and W96SpellDlg components

Declaration

procedure SetEditAsActive; dynamic;

Description

Sets the edit field on the spell dialog as the ActiveControl.  This method will rarely be called directly since it is already called for you by the SpellDlg component.


SetEditWord Method

Applies to

TAbsSpellDialog, TMSSpellDlg, TWPSpellDlg and W96SpellDlg components

Declaration

procedure SetEditWord (ToWord: string); dynamic;

Description

Set the edit field to the specified string.  This method will rarely be called directly since it is already called for you by the SpellDlg component.


SetLabelLanguage Method

Applies to

TAbsSpellDialog, TMSSpellDlg, TWPSpellDlg and W96SpellDlg components

Declaration

procedure SetLabelLanguage (ToLanguage: TLanguages); dynamic;

Description

Sets the label language to the specified language.  This method should not be called directly, but instead you should use SpellDlg.LabelLanguage.


SetNotFoundCaption Method

Applies to

TAbsSpellDialog, TMSSpellDlg, TWPSpellDlg and W96SpellDlg components

Declaration

procedure SetNotFoundCaption (ToString: string); dynamic;

Description

Sets the "word not found" caption on the spell dialog.  This method will rarely be called directly since it is already called for you by the SpellDlg component.


SetNotFoundPrompt Method

Applies to

TAbsSpellDialog, TMSSpellDlg, TWPSpellDlg and W96SpellDlg components

Declaration

procedure SetNotFoundPrompt (ToString: string); dynamic;

Description

Sets the "word not found" prompt on the spell dialog.  This method will rarely be called directly since it is already called for you by the SpellDlg component.


Show Method

Applies to

TSpellDlg

Declaration

procedure Show;

Description

Displays the spell checking dialog.  You will rarely have to call the Show method since it is called for you by the various check routines (e.g. CheckMemo, CheckEdit).


SkipList Property

See Also

Applies to

TSpellDlg component

Declaration

property SkipList: TStringList;

Description

A string list of words to skip.


SpellGbl Unit

See Also

The SpellGbl unit declares several constants and types for use by the EDSSpell checker component.

The following items are declared in the SpellGbl unit:

Types

TBigBuffer

PBigBuffer

TDialogTypes

TLanguages

Constants

AbortMesg

CompleteMesg

DictExt

Dictionaries

FoundPhrase

NoErrorMesg

NotFoundPhrase

ValidChars

Margin

MaxBuffer


SuggestWords Method

See Also

Applies to

TSpellDlg

Declaration

function SuggestWords (AWord: String; NumToList: Byte): TStringList;

Description

Suggests words from the dictionary using the provided word as a match.  You will rarely have to call the SuggestWords method since it is called for you by the various check routines (e.g. CheckMemo, CheckEdit).  It is provided in case you would like to create your own engine.


Suggestions Property

Example

Applies to

TAbsSpellDialog, TMSSpellDialog, TSpellDlg, TWPSpellDialog, TW96SpellDlg components

Declaration

property Suggestions: Byte;

Description

The Suggestions property controls the number of suggestions which will be generated by the Spell dialog when the user clicks on the suggest button of automatically if AutoSuggest is TRUE.


TAbsSpellDialog
TAbsSpellDialog Component

See Also	Properties	Methods

Unit

AbsSpell

Description

The TAbsSpellDialog is an abstract component type, derived from TForm.  You may derive a new dialog style by creating a descendant of TAbsSpellDialog.


TAbsSpellDialog Methods
Methods

ClearSuggestList	SetEditAsActive

DisableSkipButtons	SetEditWord

EnableSkipButtons	SetLabelLanguage

GetEditWord	SetNotFoundCaption

MakeSuggestions	SetNotFoundPrompt

SetAccentSet


TAbsSpellDialog Properties
Properties

  Run time   [image] Key properties

HelpContext

LabelLanguage

Suggestions


TAccentSet Type

Unit

AbsSpell

Declaration

  TAccents        = (acSpanish);

  TAccentSet      = Set of TAccents;

Description

Allows you to manipulate the whether the Spell dialog has icons to allow the user to easily input foreign characters.

Currently on spanish foreign characters are supported.


TBigBuffer
TBigBuffer Type

Unit

SpellGbl

Declaration

  TBigBuffer      = Array[1..MaxBuffer] of Char;

  PBigBuffer      = ^TBigBuffer;

Description

The TBugBuffer type is used in the EDSSpell checker component to offset into large buffers.


TDialogTypes Type

Unit

SpellGbl

Declaration

type TDialogTypes = (dtWordPerfect, dtMSWord, dtWordPro96);

Description

Determines the visual style of the spell dialog.


TLanguages Type

Unit

SpellGbl

Declaration

TLanguages = (lgEnglish, lgSpanish, lgBritish);

Description

An enumerated type of supported languages for EDSSpell checking component.


TMSSpellDlg Component

See Also	Properties	Methods

Unit

MSSpell

Description

The TMSSpellDlg is a spell dialog visually similar to the one in Microsoft Word™, and is a descendant of TAbsSpellDialog.


TSpellDlg Component

 Properties	Methods	Tasks

Unit

EDSSpell

Description

The TSpellDlg component allows the developer to easily add spell checking capabilities to their Delphi application.

You can easily check a TMemo component by calling CheckMemo.

You can customize the way the Spell dialog appears by selecting its DialogStyle.  For example, you can make the dialog appear similar to a MicroSoft Word™ by setting the DialogStyle to dtMSWord.

The number of suggestions generated by the Spell dialog can be controlled by the Suggestions property.  You may also select to have the dialog automatically suggest by setting the AutoSuggest to TRUE.

In addition to these properties and methods, this component also has the properties and methods that apply to all components.


TSpellDlg Methods

Methods

CheckAllFields	CustomEdit_WordCount

CheckCustomEdit	Destroy

CheckEdit	Edit_WordCount

CheckMemo	InDictionary

CheckOvcEditor	Memo_WordCount

CheckOvcField	MoveDialog

CheckTXControl	Open

CheckWord	OpenDictionary

CheckWPText	OvcEdit_WordCount

ClearLists	OvcField_WordCount

Close	Show

CloseDictionary	SuggestWords

Create


TSpellDlg Properties
Properties

  Run time   [image] Key properties

AccentIcons	DictionaryType

 	AutoSuggest	LabelLanguage

 	AutoShift	ReplaceList

 	DialogStyle	Replacer

 	DictionaryName	SkipList

 	DictionaryPath	Suggestions

UserDictionary


TW96SpellDlg Component

See Also	Properties	Methods

Unit

W96Spell

Description

The TW96SpellDlg is a spell dialog visually similar to the one in WordPro 96™, and is a descendant of TAbsSpellDialog.


TWPSpellDlg Component

See Also	Properties	Methods

Unit

WPSpell

Description

The TWPSpellDlg is a spell dialog visually similar to the one in WordPerfect™, and is a descendant of TAbsSpellDialog.  This is the default dialog used.


TX Text Control
TX Text-Control™

See Also

The Borland Visual Solutions Pack, Volume 1, contains several powerful VBX custom controls.  The included TX Text-Control is a WYSIWYG word processor component with separate status bar, button bar, and ruler controls.  All four controls are integrated and interface seamlessly, requiring minimal programming.  For more information on TX Text-Control consult you Visual Solutions Pack manual or contact the European Software Connection.


TurboPower Software

See Also

TurboPower Software can be contacted at:

TurboPower Software Company

P.O. Box 49009

Colorado Springs, CO  80949-9009

Sales: (800) 333-4160

Fax: (719) 260-9726

CompuServe: GO TURBOPOWER

Internet: www.tpower.com


Uncluttering the Delphi Desktop
This article first appeared in PC Techniques Magazine

Uncluttering the Delphi Desktop

The only thing that I don't like about executing Delphi is that the Windows desktop becomes cluttered if there are any other un-minimized applications.  Listing1 shows the ExDelphi project which automatically minimizes all visible applications and then executes Delphi.

To accomplish this we call EnumWindows() which runs the EnumProcs() routine for each window (visible or not).  We must test to make sure that the window is an application and not a child window.  Unfortunately, not all child windows are created with a parent, so we also test to make sure that the current window being checked has a title.

Place the compiled executable in your DELPHI\BIN directory and use it instead of calling DELPHI.EXE.  Maybe later I'll make ExDelphi to restore your Windows desktop upon exiting Delphi, but that's a different HAX.

Listing 1 - EXDELPHI.DPR

program ExDelphi;

  {-executes Delphi, minimizing all apps currently running}

  {(c) Copyright 1995, Eminent Domain Software}

{$R *.RES}

uses

  WinProcs, WinTypes, Messages;

var

  ExResult:     integer;

  ExResultSt:   string;

  EnumAddress:  TFarProc;

  function EnumProc (WinHandle: HWnd; Param: LongInt): Boolean; far;

  var

    WindowTitle:  array[0..255] of char;

  begin

    {make sure window has a title}

    GetWindowText (WinHandle, @WindowTitle, 255);

    {check to see if the current window needs to be minimized}

    if (WindowTitle[0]<>#0) and

       (GetParent (WinHandle) = 0) and

       (not IsIconic (WinHandle)) and

       (IsWindowVisible (WinHandle)) then

    begin

      SendMessage (WinHandle, WM_SYSCOMMAND, SC_MINIMIZE, 0);

    end;  { if... }

    EnumProc := TRUE;

  end; { EnumProc }

begin

  EnumAddress := MakeProcIstance (@EnumProc, 0);

  EnumWindows (EnumAddress, 0);                   {Calling all windows}

  ExResult := WinExec ('Delphi.EXE', SW_SHOW);  {Execute Delphi}

  if ExResult < 32 then

  begin

    {Error running Delphi}

    Str (ExResult, ExResultSt);

    ExResultSt := 'Error Loading Delphi : ' + ExResultSt + #0;

    MessageBox (0, @EXResultSt[1], 'EDS ExDelphi Loader',

                mb_OK or mb_IconInformation);

  end;  { if... }

  FreeProcInstance (EnumAddress);

end.  { ExDelphi }


UserDictionary
UserDictionary Property

Applies to

TSpellDlg component

Declaration

property UserDictionary: TFileName;

Description

The name of the user dictionary.  The user dictionary is now a text file which can be edited with any component.  Any number of users on a network may share the same user dictionary.  The default name is USERDCT.TXT.


Using EDSSpell

See Also

There are a few ways of using the included components and their support files.  The simplest (and recommended) way is very much like you would use a native Delphi dialog component.

1) Drop the SpellDlg component onto your form

2) Call the SpellDlg component to check a memo:

procedure TForm1.SpellCheckBtnClick (Sender: TObject);

begin

  SpellDlg1.CheckMemo (Memo1);

end;  { TForm1.SpellCheckBtnClick }

You may also elect to spell check all of the edit fields on a form:

procedure TForm1.SpellCheckBtnClick (Sender: TObject);

begin

  SpellDlg1.CheckAllFields (Self, TRUE);

end;  { TForm1.SpellCheckBtnClick }

Once you have dropped the component onto your form, you may modify its behavior by changing some of its properties.


Using EDSSpell with Orpheus

See Also

You can use the supported Orpheus components as you would any other component.  The simplest (and recommended) way is very much like you would use a native Delphi dialog component.

To check an editor component:

1) Drop the SpellDlg component onto your form

2) Call the SpellDlg component to check a text editor:

procedure TForm1.SpellCheckBtnClick (Sender: TObject);

begin

  SpellDlg1.CheckOvcEditor (Editor1);

end;  { TForm1.SpellCheckBtnClick }

To check a field component:

1) Drop the SpellDlg component onto your form

2) Call the SpellDlg component to check a field:

procedure TForm1.SpellCheckBtnClick (Sender: TObject);

begin

  SpellDlg1.CheckOvcField (OvcSimpleField1);

end;  { TForm1.SpellCheckBtnClick }

By default, Orpheus support is disabled.  This method will be unavailable unless you enable the SupportOrpheus define in the SPELLDEF.PAS file.


Using EDSSpell with TX Text-Control

See Also

You can use the supported TX Text-Control as you would any other component.  The simplest (and recommended) way is very much like you would use a native Delphi dialog component.

To check a text control component:

1) Drop the SpellDlg component onto your form

2) Call the SpellDlg component to check a text control:

procedure TForm1.SpellCheckBtnClick (Sender: TObject);

begin

  SpellDlg1.CheckTXControl (TextControl1);

end;  { TForm1.SpellCheckBtnClick }

By default, TX Text-Control support is disabled.  This method will be unavailable unless you enable the SupportTXText define in the SPELLDEF.PAS file.


Using EDSSpell with WPTools

You can use the supported WPTools as you would any other component.  The simplest (and recommended) way is very much like you would use a native Delphi dialog component.

To check a text control component:

1) Drop the SpellDlg component onto your form

2) Call the SpellDlg component to check a rich text control:

procedure TForm1.SpellCheckBtnClick (Sender: TObject);

begin

  SpellDlg1.CheckWPText (WPRichText1);

end;  { TForm1.SpellCheckBtnClick }

By default, WPTools support is disabled.  This method will be unavailable unless you enable the SupportWPTools define in the SPELLDEF.PAS file.


ValidChars Constant

Unit

SpellGbl

Declaration

const ValidChars : set of char;

Description

Contains the valid characters that can create a word.


W96Spell Unit

See Also

The W96Spell unit contains the declaration for the WordPro 96™ style spell dialog available for the EDSSpell checking component.

The following items are declared in the W96Spell unit:

Components

TW96SpellDlg


WPSpell Unit

See Also

The WPSpell unit contains the declaration for the WordPerfect™ style spell dialog available for the EDSSpell checking component.

The following items are declared in the WPSpell unit:

Components

TWPSpellDlg


WPTools
WPTools Component

See Also

WPTools is a native Delphi VCL to edit plain and rich text written by Julian Ziersch. The main component (WPRichText) supports ANSI, RTF + self defined Formats, right+left aligned, centred+justified text, clipboard support, indent, tabs, fonts,-sizes,-style,-color+background color for each character, hyperlinks, printing, printing on Canvas, search+replace, unlimited textsize, two working formats: rich- and plain text (text may then larger then 2MB!), various events and properties.  You may download WPTools.ZIP from several locations including CompuServe's Delphi Forum and on the internet at the Delphi Super Page (http://sunsite.icm.edu.pl/~robert/delphi).


ex:AutoShift

Example

The following code turns AutoShift on so that the dialog will not overlap the memo to be spell checked.

  procedure TForm1.SpellCheckClick (Sender: TObject);

  begin

    SpellDlg.AutoShift := TRUE;

    SpellDlg.CheckMemo (Memo1);

  end;


ex:AutoSuggest

Example

The following code turns on the AutoSuggest property of the spell dialog.

  procedure TForm1.SetAutoSuggest1Click (Sender: TObject);

  begin

    SpellDlg.AutoSuggest := TRUE;

  end;


ex:DialogType

Example

The following code sets the spell checker's dialog type to MicroSoft Word™ style.

  procedure TForm1.SpellCheckClick (Sender: TObject);

  begin

    SpellDlg.DialogStyle := dtMSWord;

    SpellDlg.CheckMemo (Memo1);

  end;


ex:DictionaryName

Example

The following code uses the Medical dictionary for the spell check.

  procedure TForm1.SpellCheckClick (Sender: TObject);

  begin

    SpellDlg.DictionaryName := 'MEDICAL.DIC';

    SpellDlg.CheckMemo (Memo1);

  end;


ex:DictionaryPath

Example

The following code locates the dictionary in the C:\WINDOWS directory:

  procedure TForm1.SpellCheckClick (Sender: TObject);

  begin

    SpellDlg.DictionaryPath := 'C:\WINDOWS\';

    SpellDlg.CheckMemo (Memo1);

  end;


ex:DictionaryType

Example

The following code changes the dictionary language to Spanish:

  procedure TForm1.SpanishClick (Sender: TObject);

  begin

    SpellDlg.DictionaryType := lgSpanish;

  end;


ex:LabelLanguage

Example

The following code sets the language for the spell dialog's labels and buttons to Spanish:

  procedure TForm1.SetLanguageClick (Sender: TObject);

  begin

    SpellDlg.LabelLanguage := lgSpanish;

  end;


ex:Suggestions

Example

The following code sets the number of suggestions that the Spell dialog will produce to 5.

  procedure TForm1.SetSuggestionsClick (Sender: TObject);

  begin

    SpellDlg.Suggestions := 5;  {set number of suggestions to 5}

  end;


saAbsSpell

See Also

SpellGbl Unit

EDSSpell Unit

MSSpell Unit

WPSpell Unit

W96Spell Unit


saAutoSuggest

See Also

Suggestions


saCEWordCount

See Also

Edit_WordCount

Memo_WordCount

OvcEdit_WordCount

OvcField_WordCount


saCheckAllFields

See Also

CheckCustomEdit

CheckEdit

CheckMemo

CheckOvcEdit

CheckOvcField

CheckWord


saCheckCustomEdit

See Also

CheckAllFields

CheckEdit

CheckMemo

CheckOvcEdit

CheckOvcField

CheckWord


saCheckDBMemo

See Also

CheckCustomEdit

CheckEdit

CheckMemo

CheckOvcEdit

CheckOvcField

CheckWord

Enabling support for TDBMemo


saCheckEdit

See Also

CheckAllFields

CheckCustomEdit

CheckMemo

CheckOvcEdit

CheckOvcField

CheckWord

Checking other components


saCheckMemo

See Also

CheckAllFields

CheckCustomEdit

CheckEdit

CheckOvcEdit

CheckOvcField

CheckWord


saCheckOvcEdit

See Also

CheckAllFields

CheckCustomEdit

CheckEdit

CheckMemo

CheckOvcField

CheckWord

Checking other components

Enabling Orpheus Support


saCheckOvcField

See Also

CheckAllFields

CheckCustomEdit

CheckEdit

CheckMemo

CheckOvcEdit

CheckWord

Enabling Orpheus Support


saCheckWord

See Also

CheckAllFields

CheckCustomEdit

CheckEdit

CheckMemo

CheckOvcEdit

CheckOvcField


saCheckingOtherComponents
Enabling Orpheus support


saClose

See Also

Close Dictionary

Open


saCloseDictionary

See Also

Close

Open Dictionary


saCreate

See Also

Destroy


saDestroy

See Also

Create


saDictionaryName

See Also

DictionaryPath


saDictionaryPath

See Also

DictionaryName


saEDSSpell

See Also

AbsSpell Unit

MSSpell Unit

SpellGbl Unit

WPSpell Unit

W96Spell Unit


saEDSSpellDefines

See Also

Checking other components

Using EDSSpell with Orpheus

Using EDSSpell with TX Text-Control

Using EDSSpell with WPTools


saESC

See Also

TX Text Control


saEditWordCount

See Also

CustomEdit_WordCount

Memo_WordCount

OvcEdit_WordCount

OvcField_WordCount


saInstall

See Also

EDSSpell Defines

ExDelphi

Introduction


saMSSpell

See Also

AbsSpell Unit

EDSSpell Unit

SpellGbl Unit

WPSpell Unit

W96Spell Unit


saMemoWordCount

See Also

CustomEdit_WordCount

Edit_WordCount

OvcEdit_WordCount

OvcField_WordCount


saMoveDialog

See Also

AutoShift


saOEWordCount

See Also

CustomEdit_WordCount

Edit_WordCount

Memo_WordCount

OvcField_WordCount


saOFWordCount

See Also

CustomEdit_WordCount

Edit_WordCount

Memo_WordCount

OvcEdit_WordCount


saOpen

See Also

Close

OpenDictionary


saOpenDictionary

See Also

CloseDictionary

Open


saOrpheus

See Also

TurboPower

Using EDSSpell with Orpheus


saReplaceList

See Also

ClearLists

Replacer


saSkipList

See Also

ClearLists


saSpellGbl

See Also

AbsSpell Unit

EDSSpell Unit

MSSpell Unit

WPSpell Unit

W96Spell Unit


saSuggestWords

See Also
AutoSuggest

Suggestions


saTAbsSpellDialog

See Also

TMSSpellDlg

TWPSpellDlg

TW96SpellDlg


saTMSSpellDlg

See Also

TAbsSpellDialog

TSpellDlg

TWPSpellDlg

TW96SpellDlg


saTW96SpellDlg

See Also

TMSSpellDlg

TSpellDlg

TWPSpellDlg


saTWPSpellDlg

See Also

TMSSpellDlg

TW96SpellDlg

TSpellDlg


saTXText

See Also

Enabling TX Text-Control Support

Using with TX Text-Control


saTurboPower

See Also

Orpheus


saUsingEDSSpell

See Also

CheckCustomEdit

CheckEdit

CheckOvcEdit

CheckOvcField

CheckWord

Checking a TDBMemo

Using EDSSpell with Orpheus


saUsingTXText

See Also

TX Text-Control

Enabling TX Text-Control Support


saUsingWithOrpheus

See Also

Enabling Orpheus Support

Orpheus defined

TurboPower Software


saW96Spell

See Also

AbsSpell Unit

EDSSpell Unit

MSSpell Unit

SpellGbl Unit

WPSpell Unit


saWPSpell

See Also

AbsSpell Unit

EDSSpell Unit

MSSpell Unit

SpellDlg Unit

W96Spell Unit


saWPTools

See Also

Enabling WPTools Support

Using EDSSpell with WPTools